class emopt
{
  public:
    
    // class constructor  (there can be more than one, as long as each has a different number of arguments, or argument types)
    inline emopt(const mat& in_data, const mat& in_means, const mat& in_covs, const vec& in_weights);
    inline void run(const uword max_iter);
    inline mat get_means();
    inline mat get_covs();
    inline vec get_weights();
    
    
  private:
    
    // variables that are not accessible outside of the emopt class
    const mat& data;
    const uword Dim;
    const uword N_cent;
    const uword N_data;
    
    mat means;
    mat covs;
    rowvec Lg;
    vec weights;
    mat prob_aposteriori; 
    
    inline double	calc_log_gauss_func(const vec &xn, const uword gi);
    inline double	calc_log_prob_xn(const vec &xn);
    inline void		calc_prob_aposteriori();
    inline rowvec	calc_log_prob_X();
    inline rowvec	eff_num();
};